#!/usr/bin/env python3
# -*- coding: utf-8 -*-


import numpy as np
import matplotlib.pyplot as plt 

def hanshu(x):
    return 2*x**2 + 3*x +5


x = np.linspace(-2, 1, 50)
y = hanshu(x)
plt.plot(x,y,color="red",linewidth=2.0)

plt.xlim(-2.5,1.5)
plt.ylim(0,10)

num=20
a = np.linspace(-2, 1, num)
for i in range(num):
    plt.plot([a[i],a[i]],[0,hanshu(a[i])],color="black",linewidth=1.0)
 
b = [];
for i in range(num):
    b.append([a[i],hanshu(a[i])])

c = np.array(b)
plt.plot(c[:,0],c[:,1],linewidth=1.0)  

plt.show()



